using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
namespace Character.Jarily {
    enum Property {
        Stand, Walk, Fly
    }
    internal enum RemoteAttackMode {
        Ray, KineticWeapon
    }
    internal enum AIBehaviourAttribute {
        partol, LossAim, PursueAttack
    }
    public static class ResuableCode {
        public static RaycastHit2D[] SeeCast(float SeeDirectory, float SeeAngle, float SeeDistance, int SeeDensity, LayerMask SeeMask, Transform transform, bool right) {
            RaycastHit2D[] _raycast = new RaycastHit2D[SeeDensity + 1];
            Vector3 forward = right ? Quaternion.Euler(0, 0, SeeDirectory - SeeAngle * 0.5f) * Vector2.right : Quaternion.Euler(0, 180, SeeDirectory + SeeAngle * 0.5f) * Vector2.right;
            for (int i = 0; i <= SeeDensity; i++)
                _raycast[i] = Physics2D.Raycast(transform.position, Quaternion.Euler(0, 0, SeeAngle / SeeDensity * i) * forward, SeeDistance, SeeMask);
            return _raycast;
        }
        public static void MoveTo(Vector3 position, Vector3 x) {
            //Vector2 _pos = position - transform.position;
            //bool right = _pos.x > 0 ? true : false;
            //MovePosition(right);
        }
    }
    [Serializable]
    internal class Eye {
        [SerializeField]
        internal Transform position = null;
        [SerializeField]
        [Range(0, 360)]
        internal float SeeDistance = 0f;
        [SerializeField]
        [Range(0, 360)]
        internal float SeeAngle = 0f;
        [SerializeField]
        [Range(0, 360)]
        internal float SeeDirectory = 0f;
        [SerializeField]
        [Range(0, 360)]
        [Tooltip("Set Sweep(视线扫掠)")]
        internal float SweepAngle = 0f;
        [SerializeField]
        [Range(0, 360)]
        internal float Sweepinterval = 0f;
        [SerializeField]
        [Tooltip("Set the Density of See RayCast")]
        internal int SeeDensity = 0;
        [SerializeField]
        internal LayerMask SeeMask = 0;
    }
}

